<template>
  <div class="empty_container" @click="refresh" :style="{ top: `${top}px` }">
    <div class="empty_item">
      <img src="~assets/images/shuju_img_empty.png" />
      <p>{{ title }}</p>
      <p>
        <van-button class="refresh_btn" type="info">{{ btn }}</van-button>
      </p>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    top: {
      type: [String, Number],
      default: 0,
    },
    title: {
      type: String,
      default: "",
    },
    btn: {
      type: String,
      default: "重新加载",
    },
  },
  methods: {
    refresh() {
      this.$emit("refresh");
    },
  },
};
</script>
<style lang="scss">
.empty_container {
  width: 100%;
  height: 100%;
  background: #ffffff;
  position: fixed;
  z-index: 10000;
  .empty_item {
    margin-top: 50%;
    img {
      width: 80%;
      margin-left: 10%;
    }
    p {
      color: #888888;
      font-size: 16px;
      padding: 20px;
      text-align: center;
    }
  }
  .refresh_btn{
    width: 50%;
    border-radius: 8px;
  }
}
</style>